Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
The 'repeating' npm package is a simple utility that allows you to create a new string by repeating a given string a specified number of times. It is useful for generating repeated patterns, filling spaces, or creating specific string-based designs programmatically.
String repetition
This feature allows you to repeat a string a specified number of times. The first argument is the number of times to repeat, and the second argument is the string to repeat.
const repeating = require('repeating');
console.log(repeating(3, 'abc')); // 'abcabcabc'
Similar to 'repeating', 'repeat-string' allows you to repeat a string multiple times. It offers a straightforward API similar to 'repeating' but differs slightly in implementation, which might affect performance in edge cases.
While primarily used for padding strings, 'pad' can also repeat strings to achieve the desired length. This package provides more general string manipulation capabilities compared to the singular focus of 'repeating'.
Repeat a string - fast
$ npm install --save repeating
var repeating = require('repeating');
repeating('unicorn ', 100);
//=> unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn unicorn
$ npm install --global repeating
$ repeating --help
Usage
repeating <string> <count>
Example
repeating 'unicorn ' 2
unicorn unicorn
MIT © Sindre Sorhus
FAQs
Repeat a string - fast
The npm package repeating receives a total of 3,928,220 weekly downloads. As such, repeating popularity was classified as popular.
We found that repeating demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.